package cn.taoshop.index.action;
import java.util.List;




import cn.taoshop.category.service.CategoryService;
import cn.taoshop.category.vo.Category;


import com.opensymphony.xwork2.ActionContext;


public class InitBean {
	
	// 注入一级分类的Service:
		private CategoryService categoryService;

		public void setCategoryService(CategoryService categoryService) {
			this.categoryService = categoryService;
		}
	
	  public void init(){
		
		
		List<Category> cList= this.categoryService.findAll();
		// 将一级分类存入到Session的范围:
		ActionContext.getContext().getSession().put("cList", cList);
		   	
		
	}
	
}
